<%@ page import="com.xinjie.www.service.report.ReportServiceImpl" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.List" %>
<%@ page import="com.xinjie.www.po.Report" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>处理举报</title>
    <style type="text/css">
        table {
            width: 100%;
            border: 1px solid red;
            border-collapse: collapse;
        }

        th, td {
            border: 1px solid red;
        }
    </style>
</head>
<body>
<%
    ReportServiceImpl reportService = new ReportServiceImpl();
    String tieba = request.getParameter("tieba");
    List<Report> reports = new ArrayList<>();
    try {
        reports = reportService.getReport(tieba);
    } catch (SQLException | ClassNotFoundException e) {
        e.printStackTrace();
    }
%>
<div align="center">
    <table>
        <tr>
            <th>举报id</th>
            <th>举报帖子id</th>
            <th>用户id</th>
            <th></th>
        </tr>
        <%
            for (Report report : reports) {
        %>
        <tr>
            <%="<td>"+report.getReportId()+"</td>"%>
            <%="<td>"+report.getPostId()+"</td>"%>
            <%="<td>"+report.getUserId()+"</td>"%>
            <%
                int reportId = report.getReportId();
            %>
            <td><a href="ReportPost.jsp?postId=<%=reportId%>&tieba=<%=tieba%>">查看帖子详情</a> </td>
        </tr>
        <%}%>
    </table>
    <a href="LookOwnTieba.jsp">返回</a>
</div>
</body>
</html>
